package day06;

import java.util.Scanner;

public class ChangeDemo {

    public static int change(int n1, int n2) {
        n1 = n1 + n2;
        n2 = n1 - n2;
        n1 = n1 - n2;
        return n1;
    }

    public static int change1(int n1, int n2) {
        n1 = n1 + n2;
        n2 = n1 - n2;
        n1 = n1 - n2;
        return n2;
    }

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入第一个数：");
        int a = sc.nextInt();
        System.out.println("请输入第二个数：");
        int b = sc.nextInt();
//        int a = 10;
//        int b = 20;
//        System.out.println(a);
//        System.out.println(b);

//        a = a + b;//30
//        b = a - b;//10
//        a = a - b;//20
        change(a,b);
        change1(a,b);

//        System.out.println(a);
//        System.out.println(b);
    }
}
